// FILEPATH: src/modules/game-rule/game-rule.controller.ts

import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  UseGuards,
} from '@nestjs/common';
import { GameRuleService } from './game-rule.service';
import { CreateGameRuleDto } from './dto/create-game-rule.dto';
import { UpdateGameRuleDto } from './dto/update-game-rule.dto';
import { ApiBearerAuth } from '@nestjs/swagger';
import { Auth } from 'src/common/decorators/auth.decorator';



@Auth()
@ApiBearerAuth() //
@Controller('game-rule')
export class GameRuleController {
  constructor(private readonly gameRuleService: GameRuleService) {}

  @Post()
  create(@Body() createGameRuleDto: CreateGameRuleDto) {
    return this.gameRuleService.create(createGameRuleDto);
  }

  @Get('list')
  findAll() {
    return this.gameRuleService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.gameRuleService.findOne(+id);
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateGameRuleDto: UpdateGameRuleDto,
  ) {
    return this.gameRuleService.update(+id, updateGameRuleDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.gameRuleService.remove(+id);
  }
}
